<?php

namespace app\communal\controller;


use app\Param;

/**
 * 系统推送
 * Class SystemPush
 * @package app\communal\controller
 */
class SystemPush extends Param
{
    public function _initialize()
    {
        parent::_initialize();
    }

    /**
     * 获取系统消息列表
     */
    public function getSystemMessageList()
    {
        $str_module_name = $this->_getContentParams('moduleName');
        $obj = new \app\logic\push\ClientPush('user');
        _toCompare(in_array($str_module_name, $obj->arr_client_key), '===', false, 19030); // 模块名称不正确
        unset($obj);
        $obj = new \app\logic\push\ClientPush($str_module_name);
        $int_now_page = intval($this->_getContentParams('page'));
        $int_list_rows = intval($this->_getContentParams('listRows'));
        $obj->getSystemMessageList($int_now_page, $int_list_rows);
    }

    /**
     * 获取系统消息详情
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getSystemMessageInfo()
    {
        $str_module_name = $this->_getContentParams('moduleName');
        $obj = new \app\logic\push\ClientPush($str_module_name);
        $int_message_id = $this->_getContentParams('messageId');
        $obj->getMessageInfo('system', $int_message_id);
    }
}
